Skip to content

Added switch statement#18

Open
flupe wants to merge 2 commits intomasterfrom
switch
Open

Added switch statement#18
flupe wants to merge 2 commits intomasterfrom
switch

Conversation

@flupe
Copy link
Owner

@flupe flupe commented Nov 26, 2023

Closes #15.

PoC implementation of embedded pattern-matching on SOP-encoded datatypes.

Caveats & limitations:

  • Pattern synonyms have to be defined manually (but could be derived "easily" with TemplateHaskell)
  • Pattern matches using switch have to be exhaustive, or the build script will fail before being evaluated.
  • switch only matches one layer deep which, considering we have to exhaustively generate all possible patterns to figure out branches, is a nice way to make sure we don't explode the search space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branching combinators

1 participant